package cc.idoone.jasperreport.test;

import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;

/**
 * jrxml 文档编译保存为 jasper 文档测试
 * 
 * @author hemj
 * @date 2017年2月14日
 */
public class JasperReportCompile {

	public static void main(String[] args) {
		String sourceFileName = "samples/jrtemplates/jasper_report_template.xml";

		System.out.println("Compiling Report Design ...");
		try {
			// 将会在同目录下生成同名且扩展名为 jasper 的文档
			// Compile the report to a file name same as the JRXML file name
			JasperCompileManager.compileReportToFile(sourceFileName);
		} catch (JRException e) {
			e.printStackTrace();
		}
		System.out.println("Done compiling!!! ...");
	}
}
